From b0a288f03774d3df6f4502af7748a52012e05029 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sun, 8 Oct 2023 11:38:53 +0100 Subject: Generate Patio code for stack IR switch instruction --- ...mpiler.testing.snapshots.Snapshotter)].expected | 59 ++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.patio.PatioCodeGenSwitchTests]/[method:canGenerateCodeForSwitchWithSingleResult(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected (limited to 'snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.patio.PatioCodeGenSwitchTests]/[method:canGenerateCodeForSwitchWithSingleResult(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected') diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.patio.PatioCodeGenSwitchTests]/[method:canGenerateCodeForSwitchWithSingleResult(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.patio.PatioCodeGenSwitchTests]/[method:canGenerateCodeForSwitchWithSingleResult(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected new file mode 100644 index 00000000..a738ad65 --- /dev/null +++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.patio.PatioCodeGenSwitchTests]/[method:canGenerateCodeForSwitchWithSingleResult(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected @@ -0,0 +1,59 @@ +Compilation unit elements: + + +Locals: + * (val "tmp__0" int) + * (val "tmp__1" int) + * (val "tmp__2" int) + * (val "tmp__3" int) + * (val "tmp__4" int) + * (val "tmp__5" int) + * (val "tmp__6" int) + +Instructions: + +( + ( + switch + ((local "tmp__0")) + (local "condition") + ( + ( + case + 0 + ( + block + ( + (local-store (local "tmp__1") (int 1)) + (local-store (local "tmp__2") (int 2)) + (int-add (local "tmp__3") (local "tmp__1") (local "tmp__2")) + ) + results=((local "tmp__3")) + ) + ) + ( + case + 1 + ( + block + ( + (local-store (local "tmp__4") (int 101)) + (local-store (local "tmp__5") (int 102)) + (int-add (local "tmp__6") (local "tmp__4") (local "tmp__5")) + ) + results=((local "tmp__6")) + ) + ) + ) + ( + block + ( + (unreachable) + ) + results=() + ) + ) +) + +Temporary stack: + * other -- cgit v1.2.3